package homework.work8;

public class Rectangle {
    private int longSide;
    private int shortSide;

    //面积
    public int area(){
        return this.longSide*this.shortSide;
    }

    //周长
    public int perimeter(){
        return 2*(this.shortSide+this.longSide);
    }

    //构造器
    public Rectangle() {
    }

    public Rectangle(int longSide, int shortSide) {
        this.longSide = longSide;
        this.shortSide = shortSide;
    }

    //get  or set longside&shortside
    public int getLongSide() {
        return longSide;
    }

    public void setLongSide(int longSide) {
        this.longSide = longSide;
    }

    public int getShortSide() {
        return shortSide;
    }

    public void setShortSide(int shortSide) {
        this.shortSide = shortSide;
    }
}
